<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserNotificationPivotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_notification_pivot', function (Blueprint $table) {
            $table->unsignedInteger('user_id')->index()->comment('用户ID');
            $table->uuid('notification_id')->index()->comment('通知ID');
			$table->timestamp('read_at')->nullable()->comment('查看时间');
			$table->timestamp('deleted_at')->nullable()->comment('删除时间');
            $table->primary(['user_id', 'notification_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_notification_pivot');
    }
}
